.TH E1432_SET_DATA_MODE 3 E1432
.SH NAME
.nf
e1432_set_data_mode \- Set data collection mode
e1432_get_data_mode \- Get current data collection mode
.fi
.IX e1432_set_data_mode(3) 3
.IX e1432_get_data_mode(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_data_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 mode)
SHORTSIZ16 e1432_get_data_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *mode)
.cE
.SH DESCRIPTION
\fIe1432_set_data_mode\fR sets the data collection mode,
of a single channel or group of channels \fIID\fR,
to the value given in \fImode\fR.

\fIe1432_get_data_mode\fR returns the current state of the data collection
mode, of a single channel or group of channels \fIID\fR,
into a memory location pointed to by \fImode\fR.

This parameter is a "global" parameter.  It applies to an entire E1432
module rather than to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fImode\fR selects whether the E1432's data collection operates in
block mode, overlap block mode, overlap freerun mode, or continuous
mode.

\fBE1432_BLOCK_MODE\fR selects block transfer mode.  In this mode, the
E1432 will stop collecting data, and go to the \fBIDLE\fR state, as soon as
one scan of data has been collected and transferred to the host.

\fBE1432_DATA_MODE_OVERLAP_BLOCK\fR selects overlap block mode.  The
main difference between overlap block mode and block mode is that
overlap block mode allows more arms and triggers to occur before an
already-acquired block is sent to the host.  Each time a trigger
occurs, the trigger time is remembered so that the data for that
trigger can eventually get sent to the host.  There is no longer a
constraint that the trigger must occur after the end of the previous
block, so overlapping blocks are possible (hence the name "overlap
block mode").  As in continuous mode, there is an overlap parameter
which controls how much overlap is allowed between consecutive blocks.

By using \fIe1432_set_fifo_size\fR, overlap block mode can be configured to
act exactly like block mode.  If the FIFO size is set the same as the
block size then overlap block mode becomes identical to block mode.
There are no visible differences at all.

\fBE1432_DATA_MODE_OVERLAP_FREERUN\fR selects overlap freerun mode.
This mode is like overlap block mode in that it allows an arm or
trigger to occur before an already-acquired block is sent to the host,
and it allows overlapping blocks.  However, this mode tries not to
queue up pending triggers, so that the data sent to the host is the
most recent data available.

\fBE1432_CONTINUOUS_MODE\fR selects continuous data mode.  In this
mode, the E1432 stays in the \fBMEASURE\fR state and collects data until the
FIFO overflows or the measurement is stopped by the host.  In that
case it goes to the \fBIDLE\fR state.

This parameter may also be set with \fIe1432_set_data_format\fR.
.SH "RESET VALUE"
After a reset, \fImode\fR is set to \fBE1432_DATA_MODE_OVERLAP_BLOCK\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_data_format, e1432_set_fifo_size
.ad
